def judge(score):
    if 90 <= score <= 100:
        return 'A'
    elif 80 <= score <= 89:
        return 'B'
    elif 70 <= score <= 79:
        return 'C'
    elif 60 <= score <= 69:
        return 'D'
    elif 0 <= score <= 59:
        return 'E'
    else:
        return '成绩有误'
class student:
    def __init__(self, name, math, chinese, english):
        self._name = name
        self._math = math
        self._chinese = chinese
        self._english = english
        self._mathlevel = None
        self._chineselevel = None
        self._englishlevel = None


    def scoring(self):
        self._mathlevel = judge(self._math)
        self._chineselevel = judge(self._chinese)
        self._englishlevel = judge(self._english)

    def display(self):
        print(self._name)
        print('数学等级为', self._mathlevel)
        print('语文等级为', self._chineselevel)
        print('英语等级为', self._englishlevel)


David = student('David', 89, 50, 78)
David.scoring()
David.display()